home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / pd / netz / amislate / slaterexx / explode2.rexx < prev    next >
OS/2 REXX Batch file  |  1995-08-05  |  1KB  |  49 lines

  1. /* An Arexx script for use with AmiSlate:  
  2.  
  3.     Draws explosions emanating from the mouse whenever the mouse
  4.     button is depressed.
  5.    
  6. */
  7. AMessage.QUIT        = 32    /* AmiSlate is shutting down */
  8. AMessage.MOUSEMOVE   = 2048     /* User moved the mouse */
  9.  
  10. parse arg CommandPort ActiveString
  11.  
  12. address (CommandPort)
  13.  
  14. if (length(CommandPort) == 0) then do
  15.     say ""
  16.     say "Usage:  rx explode.rexx <REXXPORTNAME>"
  17.     say "        (REXXPORTNAME is usually AMISLATE)"
  18.     say ""
  19.     say "Or run from the Rexx menu within AmiSlate."
  20.     say ""
  21.     exit 0
  22.     end
  23.  
  24.  
  25. options results
  26.  
  27. GetWindowAttrs stem win.
  28.  
  29. MaxX = (win.width - 59)
  30. MaxY = (win.height - 54)
  31.  
  32. range = 35
  33. halfrange = trunc(range/2)
  34.  
  35. do while (1)
  36.     waitevent 0 stem event. MOUSEMOVE MOUSEDOWN MOUSEUP QUIT
  37.     
  38.     if (event.type == AMessage.QUIT) then exit
  39.     
  40.     if (event.button > 0) then do    
  41.         xx = event.mousex + rand(range) - halfrange
  42.         yy = event.mousey + rand(range) - halfrange
  43.         line event.mousex event.mousey xx yy
  44.         setfcolor rand(15) rand(15) rand(15) notbackground
  45.         end
  46. end
  47.  
  48. rand:
  49.     return trunc(Random()*arg(1)/1000)